<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport"
	content="width=device-width initial-scale=1.0  maximum-scale=1.0">
<link href="${ctxStatic}/jquery-mobile/css/jquery.mobile-1.3.1.min.css" type="text/css" rel="stylesheet" />
<title>问卷调查</title>
<%@ include file="/static/member/themes/ShiShangHong/header.jsp" %>
<link href="${ctxStatic}/jquery-validation/1.11.0/jquery.validate.min.css" type="text/css" rel="stylesheet" />
<script src="${ctxStatic}/jquery-validation/1.11.0/jquery.validate.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-validation/1.11.0/jquery.validate.method.min.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function() {
	$("#inputForm").validate({
	});
});
</script>
</head>
<body>
<div class="main">
<c:if test="${not empty message  }">
						<span class="alert" >${message}</span>
</c:if>
	<div class="p_mod o_address">
    		<h2 class="p_mod_title">${questionnaire.name }</h2>
            <div id="city" style="font-size: 12px;">
            ${questionnaire.description }
            </div>
    	</div>
    <form id="inputForm" method="post" action="${ctxFront}/wechat/questionnaireReply/save" >
    <input type="hidden" name="wechatId"  value="${wechatId }">
		<input type="hidden"  value="${questionnaire.id }"  name="questionnaireId">
		<c:forEach items="${questionList }" var="question" varStatus="var">
    	<div class="p_mod o_address">
    		<h2 class="p_mod_title">${question.question }</h2>
            <div id="city">
    		<ul>
    		<c:if test="${question.type==0 }">
    		<c:forEach items="${question.option }"  var="option">
   			  <label>
   			  <li >
   			 <label> <input   name="option${question.id}" type="radio"    value="${option.id }" class="required"    />${option.name }</label>
   			  	</li>
   			  </label>
    		</c:forEach>
    		</c:if>
    		<c:if test="${question.type==1 }">
    		<c:forEach items="${question.option }"  var="option">
   			 <label> <li><input   name="option${question.id}" type="checkbox"   value="${option.id }" class="required"/>${option.name }	</li><label>
    		</c:forEach>
    		</c:if>
    		<c:if test="${question.type==2 }">
   			  <label><li><input placeholder="请输入"   name="option${question.id}" type="text"   class="required" />	</li></label>
    		</c:if>
    		</ul>
            </div>
    	</div>
    	</c:forEach>
    	
    	<c:if test="${questionnaire.type ne 1 }">
    	<div class="p_mod o_address">
    		<h2 class="p_mod_title">请填写您注册会员时所使用的手机号</h2>
            <div id="city">
            <ul>
    			<li><strong>手机号：</strong><input placeholder="请输入手机号" id="mobile" name="mobile" type="text" class="required"	 /></li>
    		</ul>
    		感谢您参与本次问卷调查，我们会尽快整理相关数据，请您持续关注${questionnaire.user.name }。我们将在活动开始的第一时间向您推送关于活动的详细信息。  
            </div>
    	</div>
    	</c:if>
    	
    	<div class="o_btn clearfix">
    	<c:if test="${questionnaire.startup eq '0' }"><input class="o_btn_back ts1" value="提交问卷" style="margin-bottom:10px;" type="submit"></c:if>
    	<c:if test="${questionnaire.startup eq '1' }"><input class="o_btn_back ts1" value="提交问卷" onclick="alert('问卷还未开启！');" style="margin-bottom:10px;" type="button"></c:if>
    		
    	</div>
    </form>
	
</div>
<script type="text/javascript">
function checkform() {
    if ($('#username').val() == '' || $('#userpass').val() == '' ) {
        alert('请填写完所有项！');
        return false;
    }   
}
</script>
</body>


</html>